home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol A-4
/
(Vol A-4) Vol. A4.iso
/
Games
/
the-kitchen-of-doom.swf
/
scripts
/
DefineSprite_1104
/
frame_21
/
DoAction.as
Wrap
Text File
|
2008-03-14
|
4KB
|
147 lines
function showScores(pg)
{
var _loc2_ = pg;
var _loc1_ = 0;
while(_loc1_ < 10)
{
hiscoreTableInst["n" + _loc1_] = scores["n" + (_loc1_ + _loc2_ * step)];
hiscoreTableInst["s" + _loc1_] = p + scores["s" + (_loc1_ + _loc2_ * step)] + s;
if(hiscoreTableInst["n" + _loc1_] == undefined)
{
hiscoreTableInst["n" + _loc1_] = " - ";
}
if(scores["s" + (_loc1_ + _loc2_ * step)] == undefined)
{
hiscoreTableInst["s" + _loc1_] = p + "0000000" + s;
}
if(_loc2_ * step + _loc1_ + 1 > 9)
{
hiscoreTableInst["num" + _loc1_] = _loc2_ * step + _loc1_ + 1;
}
else
{
hiscoreTableInst["num" + _loc1_] = "0" + (_loc2_ * step + _loc1_ + 1);
}
_loc1_ = _loc1_ + 1;
}
}
stop();
if(_parent.sendToFriendMode == 0)
{
challengeButtonInst._visible = false;
sendButtonInst._visible = true;
}
else
{
challengeButtonInst._visible = true;
sendButtonInst._visible = false;
}
sendButtonInst.onRelease = function()
{
var _loc1_ = _parent;
_global.sfxUI.start();
_loc1_.sendBoxInst._visible = true;
Selection.setFocus(_loc1_.sendBoxInst.name);
_loc1_.sendBoxInst.name.text = "";
_loc1_.sendBoxInst.email.text = "";
menuButtonInst.enabled = false;
sendButtonInst.enabled = false;
downArrowInst.enabled = false;
upArrowInst.enabled = false;
};
challengeButtonInst.onRelease = function()
{
var _loc1_ = _parent;
_global.sfxUI.start();
_loc1_.challengeBoxInst._visible = true;
Selection.setFocus(_loc1_.challengeBoxInst.name);
_loc1_.challengeBoxInst.name.text = "";
_loc1_.challengeBoxInst.email.text = "";
menuButtonInst.enabled = false;
sendButtonInst.enabled = false;
downArrowInst.enabled = false;
upArrowInst.enabled = false;
};
page = 0;
maxPage = 4;
step = 10;
upArrowInst._visible = false;
upArrowInst.enabled = false;
downArrowInst.enabled = false;
upArrowInst.onRelease = function()
{
_global.sfxUI.start();
page--;
showScores(page);
downArrowInst._visible = true;
if(page == 0)
{
upArrowInst._visible = false;
}
};
downArrowInst.onRelease = function()
{
_global.sfxUI.start();
page++;
showScores(page);
upArrowInst._visible = true;
if(page == maxPage)
{
downArrowInst._visible = false;
}
};
var i = 0;
while(i < 10)
{
hiscoreTableInst["n" + i] = " - ";
hiscoreTableInst["s" + i] = p + "0000000" + s;
i++;
}
scores = new LoadVars();
scores.game = hiscoreTable;
scores.gameID = hiscoreTableID;
if(_parent.scoreMode == 0)
{
scores.cmd = "1";
}
else
{
scores.cmd = "0";
scores.name = nameEntry;
scores.score = scoreEntry;
}
scores.onLoad = function(success)
{
if(success)
{
if(this.res == "0")
{
gotoAndStop("HiscoreFail");
play();
}
else
{
for(var _loc1_ in scores)
{
i++;
if(i % 2 == 1)
{
hiscoreTableInst[_loc1_] = p + scores[_loc1_] + s;
}
else
{
hiscoreTableInst[_loc1_] = scores[_loc1_];
}
}
upArrowInst.enabled = true;
downArrowInst.enabled = true;
}
}
else
{
gotoAndStop("HiscoreFail");
play();
}
};
scores.sendAndLoad("http://hiscores.fishinabottle.com/submitscore.php",scores,"POST");